file = open("sample.txt", 'r') while True: line = file.readline() if not line: break pass # do something
Reference: Reading text files
Hide Comments
Hide Comments